Skip to content

mod: switch to upstream github.com/go-playground/validator/v10 - #53

Merged
unknwon merged 1 commit into
mainfrom
upstream-validator
Nov 8, 2026
Merged

unknwon merged 1 commit into
mainfrom
upstream-validator

Conversation

@unknwon

@unknwon unknwon commented Nov 8, 2026

Copy link
Copy Markdown
Member

Switch from the github.com/flamego/validator fork to upstream github.com/go-playground/validator/v10 v10.30.6. The fork is v10.9.0 with go-playground's own translation system removed and is being archived.

i18n with flamego/i18n keeps working: upstream's FieldError has the same Tag() and Param() used in the localization docs.

Breaking changes

  • Options.Validator is now *github.com/go-playground/validator/v10.Validate; update imports.
  • The minimum Go version is 1.26, as required by upstream.
  • The default FieldError.Error() text changes from Key: "user.Age" Error: Field validation for "Age" ... to upstream's Key: 'user.Age' Error:Field validation for 'Age' ....
  • Upstream panics on dive applied to a field that isn't a slice or map, which v10.9.0 silently ignored. The test fixtures had this on a struct field and are fixed here.

Test plan

  • go vet ./... and go test ./... pass on Go 1.26.3.

The flamego/validator fork (v10.9.0 minus go-playground's own
translations) is being archived. Upstream exposes the same
FieldError.Tag()/Param() used for i18n with flamego/i18n.

- Use github.com/go-playground/validator/v10 v10.30.6, which requires Go 1.26.
- Update expected error strings to upstream's format.
- Drop invalid `dive` on struct fields in test fixtures; upstream panics on
  dive over a non-slice/map where v10.9.0 silently ignored it.

Amp-Thread-ID: https://ampcode.com/threads/T-01a1bbb1-1c5a-77ba-9e12-d22c3eb7db02
@unknwon
unknwon merged commit 6a436fd into main Nov 8, 2026
4 checks passed
@unknwon
unknwon deleted the upstream-validator branch November 8, 2026 16:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant